﻿<div class="form-group" ng-controller="AutocompleteController" ng-init="init('owner',acc.type, acc.id)">
    <label class="col-sm-8">Name</label>
    <label class="col-sm-4 text-right">[<a ng-href="{{acc.data.CrmUrl}}" tabindex="-1" target="_blank">CRM</a>]</label>
    <div class="col-xs-12">
        <span class="k-widget k-autocomplete k-header k-input k-state-default">
            <input kendo-auto-complete class="k-input" onclick="this.select();" k-options="autocomplete" ng-change="getData()" tabindex="100"
                ng-model="model" ng-init="model=acc.data.Name" id="{{info.type+info.name+info.id}}" />
            <span class="k-icon k-loading" ng-style="currStyle"></span>
        </span>
    </div>
</div>

<div class="form-group" ng-controller="AutocompleteController" ng-init="init('oper',acc.type, acc.id)">
    <label class="col-sm-8">Operator</label>
    <label class="col-sm-4 text-right">[<a tabindex="-1" ng-href="{{acc.oper.CrmUrl}}" target="_blank">CRM</a>]</label>
    <div class="col-xs-12">
        <span class="k-widget k-autocomplete k-header k-input k-state-default">
            <input kendo-auto-complete class="k-input" onclick="this.select();" id="{{info.type+info.name+info.id}}" ng-change="getData()" tabindex="100"
                k-options="autocomplete" ng-model="model" ng-init="model=acc.oper.Name" />
            <span class="k-icon k-loading" ng-style="currStyle"></span>
        </span>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-8">Contact</label>
    <label class="col-sm-4 text-right">[<a tabindex="-1" ng-href="{{acc.selectedValue.EditUrl}}" target="_blank">CRM</a>]</label>
    <div class="col-xs-12">
        <select class="form-control" ng-model="acc.selectedValue" ng-keydown="changeSelection($event)" id="{{'dd'+acc.type+acc.id}}" ng-change="changedContact(acc.selectedValue)" tabindex="100"
            ng-options="i.Name for i in acc.oper.Contacts">
            <option value=""></option>
        </select>
    </div>
</div>

<div class="form-group">
    <div class="col-xs-12">
        <label>Email:</label>
        <p><a href="mailto:{{acc.selectedValue.EmailAddress}}" target="_blank">{{acc.selectedValue.EmailAddress}}</a></p>
    </div>
</div>

<div class="form-group">
    <div class="col-xs-12">
        <label>Telephone:</label>
        <p>{{acc.selectedValue.Telephone}}</p>
    </div>
</div>

<div class="form-group">
    <div class="col-xs-12">
        <label>Mobile phone:</label>
        <p>{{acc.selectedValue.MobilePhone}}</p>
    </div>
</div>
